<script setup>
	import { handleLogin } from '@/utils/singleLogin';

	import useBuriedPoint from '@/hooks/useBuriedPoint';
	import { useRouter } from 'vue-router';
	const router = useRouter();

	import { useGlobalStore, useAuthStore } from '@/stores';
	const { setOlderUI } = useGlobalStore();
	const { logged, setLogged } = useAuthStore();

	//useBuriedPoint();

	// 获取适老化状态
	ZWJSBridge?.getUiStyle().then(({ uiStyle }) => {
		const isOlder = uiStyle == 'elder';
		setOlderUI(isOlder);
		if (isOlder) document.documentElement.style.fontSize = 18 + 'px';
		router.push('/home');
	});
	if (logged) ZWJSBridge?.close(); //解决二次回退

	setLogged(true);
</script>

<template>
	<section class="full flex-center">
		<img
			class="loading"
			src="@/assets/icons/loading.svg"
			alt=""
		/>
	</section>
</template>

<style lang="less" scoped>
	@keyframes loading {
		from {
			transform: rotate(0deg);
		}

		to {
			transform: rotate(360deg);
		}
	}
	.loading {
		animation: loading 3s infinite;
	}
</style>
